﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Zone;
using Maticsoft.DBUtility;
using System.Data.OleDb;
using System.Windows.Forms;
namespace SmsSend
{
    /// <summary>
    /// 本项目中使用到的类，非通用
    /// </summary>
    public class SmsClass
    {

        #region ssk皮肤测试随机两位数字
        /// <summary>
        /// ssk皮肤测试随机两位数字
        /// </summary>
        /// <returns></returns>
        public static string Get123()
        {
            Func2 f2 = new Func2();
            int i = Convert.ToInt32((f2.GetRandomCodeInt(1)));
            if (i > 7) i = 2;
            string s1 = f2.GetRandomCodeInt(1);
            return i.ToString() + s1;

        }
        #endregion

        public static void SetWebBrowerCookie(string url, ref WebBrowser webBrowser1)
        {            
            WebClient_LoadWeb wc = new WebClient_LoadWeb();
            wc.SetWebBrowerCookie(Init_GlobalSetting.CookCollection, Init_GlobalSetting.CookContainer, url);

            try
            {
                webBrowser1.Refresh(WebBrowserRefreshOption.Completely);                      
                webBrowser1.Navigate(url);
                
            }
            catch(Exception ex)
            {
                Logger.Trace(ex);
            }
        }

        public static void ShowYongHuMing()
        {
            Init_GlobalSetting.yonghuming = "张三张三张三张普通用户";
            Init_GlobalSetting.quanxian = "普通用户普通用户";
            Init_GlobalSetting.danxindanjia1 = "0.1元/条 (短信)";
            Init_GlobalSetting.danxindanjia2 = "0.5元/条 (彩信)";
            Init_GlobalSetting.yu_e = "3466666666666632.20 元";                   
        }

        public bool CheckUser()
        {
            bool bl = false;
            //string sql = "select * from df_content";
            
            int i = 0;
            try
            {
                //i = (int)(DbHelperOra.GetMaxID("id", "df_content"));
                i = (int)DbHelperOleDb.GetMaxID("id", "df_content");
                DebugNew.DebugMethod(i.ToString());
            }
            
            catch (Exception ex)
            {
                Logger.Trace(ex);
            }
            
            
            return bl;
        }
        public OleDbDataReader GetDR()
        {
            OleDbDataReader dr = null;
            string sql = "select * from df_content";
            try
            {
                dr = DbHelperOleDb.ExecuteReader(sql);
            }
            catch (Exception ex)
            {
                Logger.Trace(ex);
            }

            return dr;
        }
        
	}
}
